package com.coincalf.wallet.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 归集纪录表
 */
@Data
@TableName("collect_coin_record")
public class CollectCoinRecord {

    private static final long serialVersionUID = 1L;

    /**
     * 自增id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 归集来源的充币记录Id,多个用英文逗号分隔开
     */
    @TableField("coin_recharge_id")
    private String coinRechargeId;

    /**
     * 归集来源的充币userId,多个用英文逗号分隔开
     */
    @TableField("user_id")
    private String userId;

    /**
     * 转账地址,多个用英文逗号分隔开
     */
    @TableField("from_address")
    private String fromAddress;

    /**
     * 收款地址
     */
    @TableField("to_address")
    private String toAddress;

    @TableField("coin_id")
    private Long coinId;

    @TableField("coin_name")
    private String coinName;

    /**
     * 本次归集交易数量=归集实际到账
     */
    @TableField("collect_amount")
    private BigDecimal collectAmount;

    /**
     * 矿工费
     */
    private BigDecimal fee;

    /**
     * 交易id(交易哈希)
     */
    @TableField("tx_id")
    private String txId;

    /**
     * 本次归集交易状态  1 成功 2 失败 3 待确认
     */
    @TableField("tx_status")
    private Integer txStatus;

    /**
     * 修改时间
     */
    @TableField("last_update_time")
    private Date lastUpdateTime;

    /**
     * 创建时间
     */
    @TableField("created")
    private Date created;
}
